using System;
using System.Collections.Generic;
using System.Text;
using SharpMud.MudLib.Common.Environment.Persistance;

namespace SharpMud.MudLib.NovaSMAUG.Environment.Persistance.Legacy
{
    public sealed class AreaLoadResults : MudLib.Common.Environment.Persistance.AreaLoadResults<AreaInstance>
    {
        private AreaDefinition  _LoadedAreaDefinition;
        private string          _FileName;

        internal AreaLoadResults()
        {
        }

        internal void AddMessage(IAreaLoadMessage message)
        {
            base._AreaLoadMessages.Add(message);
        }
        internal void AddMessage(string message, string filename, bool isCritical)
        {
            AddMessage(new AreaLoadMessage(message, filename, -1, -1, isCritical));
        }

        public new AreaInstance LoadedArea
        {
            get
            {
                return (base._LoadedArea as AreaInstance);
            }
            internal set
            {
                if (base._LoadedArea == null)
                    base._LoadedArea = value;
                else
                    throw new InvalidOperationException();
            }
        }

        public AreaDefinition LoadedAreaDefinition
        {
            get
            {
                return _LoadedAreaDefinition;
            }
            internal set
            {
                if (_LoadedAreaDefinition == null)
                    _LoadedAreaDefinition = value;
                else
                    throw new InvalidOperationException();
            }
        }

        public string FileName
        {
            get
            {
                return _FileName;
            }
            internal set
            {
                if (_FileName == null)
                    _FileName = value;
                else
                    throw new InvalidOperationException();
            }
        }

        public int area_version;
    }
}
